package com.cyzy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cyzy.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 小程序首页数据Mapper接口
 * @author yangJingShi
 * @date 2025/1/19
 */
@Mapper
public interface MiniprogramHomeMapper extends BaseMapper<Object> {

    /**
     * 查询上架的轮播图列表
     */
    @Select("SELECT * FROM su_banner_ads WHERE status = 1 ORDER BY publishTime DESC")
    List<SuBannerAds> selectActiveBanners();

    /**
     * 查询上架的商品列表
     */
    @Select("SELECT * FROM su_external_goods WHERE status = 1 ORDER BY id ASC LIMIT 20")
    List<SuExternalGoods> selectActiveGoods();

    /**
     * 查询上架的快捷入口列表
     */
    @Select("SELECT * FROM su_quick_entries WHERE status = 1 ORDER BY id ASC")
    List<SuQuickEntries> selectActiveQuickEntries();

    /**
     * 查询上架的功能入口列表
     */
    @Select("SELECT * FROM su_function_entries WHERE status = 1 ORDER BY id ASC")
    List<SuFunctionEntries> selectActiveFunctionEntries();

    /**
     * 查询上架的校区公告列表
     */
    @Select("SELECT * FROM su_campus_ads WHERE status = 1 ORDER BY publishTime DESC LIMIT 10")
    List<SuCampusAds> selectActiveNotices();

    /**
     * 查询上架的品牌推荐列表
     */
    @Select("SELECT * FROM su_brand_recommendations WHERE status = 1 ORDER BY id ASC")
    List<SuBrandRecommendations> selectActiveRecommendations();
} 